package com.zn.common.exception;

import lombok.extern.slf4j.Slf4j;

/**
 * @author xyl
 * @create 2020/7/1 10:15
 * @desc 自定义异常 , 用于拦截器中 , 判断权限与请求不一致 , 返回的异常信息
**/
@Slf4j
public class MyException extends RuntimeException {
    private Integer code;

    public MyException(Integer code, String message) {
        super(message);
        log.error(message);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
